package com.sqsf.jdk;
//jdk代理是基于接口
//代理对象与目标对象实现相同的接口
public class JDKProxy implements JDKInterface{
    JDKInterface jDKInterface;
    //传入被代理的对象
    public JDKProxy(JDKInterface JDKInterface) {
        this.jDKInterface = JDKInterface;
    }

    @Override
    public void run() {
        //在调用原方法前执行额外功能
        System.out.println("other method run......");
        jDKInterface.run();
    }
}